
package de.dtools.n2g.res;

/**
 *	@project:	note2go
 *	@author:	D.Toepel
 *	@version:	2009-08-04
 *	@note:		---
 *	
 *	Copyright (C) 2009  D.Toepel <de.dtools> {at} <gmail> {dot} <com>
 *	
 *	This program is free software: you can redistribute it and/or modify
 *	it under the terms of the GNU General Public License as published by
 *	the Free Software Foundation, either version 3 of the License, or
 *	(at your option) any later version.
 *	
 *	This program is distributed in the hope that it will be useful,
 *	but WITHOUT ANY WARRANTY; without even the implied warranty of
 *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *	GNU General Public License for more details.
 *	
 *	You should have received a copy of the GNU General Public License
 *	along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *	
 */

import java.io.File;
import java.net.*;

import javax.swing.*;

import org.apache.commons.lang.SystemUtils;

/**
 * Verwalten der Resourcen fuer Note2Go 
 * @author daniel
 *
 */
public class Resource {
	
	private static String PNGPATH = "de/dtools/n2g/res/png/";
	private static String HTMPATH = "de/dtools/n2g/res/htm/";
	
	
/* *******************************************
 * Graphiken fuer Hauptprogramm laden
 */
	public final ImageIcon getAddTagIcon(){
		ImageIcon addTag = new ImageIcon(
	    		getClass().getClassLoader().getResource(PNGPATH + "addTag24.png"));
		return addTag;
	}
	public final ImageIcon getDeleteTagIcon(){
		ImageIcon delTag = new ImageIcon(
	    		getClass().getClassLoader().getResource(PNGPATH + "deleteTag24.png"));
		return delTag;
	}
	public final ImageIcon getReloadTagIcon(){
		ImageIcon relTag = new ImageIcon(
	    		getClass().getClassLoader().getResource(PNGPATH + "refresh.png"));
		return relTag;
	}
	public final ImageIcon getCloseXIcon(){//remove_exc.gif
		ImageIcon close1 = new ImageIcon(
	    		getClass().getClassLoader().getResource(PNGPATH + "closeOut.png"));
		return close1;
	}
	public final ImageIcon getCloseXIconRollover(){//error_obj.gif
		ImageIcon close2 = new ImageIcon(
	    		getClass().getClassLoader().getResource(PNGPATH + "close.png"));
		return close2;
	}
	public final ImageIcon getAddNoteIcon(){
		ImageIcon addTag = new ImageIcon(
	    		getClass().getClassLoader().getResource(PNGPATH + "newNote.png"));
		return addTag;
	}
	public final ImageIcon getDeleteNoteIcon(){
		ImageIcon delTag = new ImageIcon(
	    		getClass().getClassLoader().getResource(PNGPATH + "del24.png"));
		return delTag;
	}
	public final ImageIcon getReloadNoteIcon(){
		ImageIcon relTag = new ImageIcon(
	    		getClass().getClassLoader().getResource(PNGPATH + "reloadNote.png"));
		return relTag;
	}
	public final ImageIcon getSaveNoteIcon(){
		ImageIcon relTag = new ImageIcon(
	    		getClass().getClassLoader().getResource(PNGPATH + "saveNote.png"));
		return relTag;
	}
	public final ImageIcon getHelpIcon(){
		ImageIcon relTag = new ImageIcon(
	    		getClass().getClassLoader().getResource(PNGPATH + "help.png"));
		return relTag;
	}
	public final ImageIcon getOptionIcon(){
		ImageIcon relTag = new ImageIcon(
	    		getClass().getClassLoader().getResource(PNGPATH + "prefs.png"));
		return relTag;
	}
	public final ImageIcon getAboutIcon(){
		ImageIcon relTag = new ImageIcon(
	    		getClass().getClassLoader().getResource(PNGPATH + "info.png"));
		return relTag;
	}
	public final ImageIcon getLeftArrowIcon(){
		ImageIcon relTag = new ImageIcon(
	    		getClass().getClassLoader().getResource(PNGPATH + "leftArrow.png"));
		return relTag;
	}
	public final ImageIcon getRightArrowIcon(){
		ImageIcon relTag = new ImageIcon(
	    		getClass().getClassLoader().getResource(PNGPATH + "rightArrow.png"));
		return relTag;
	}
	public final ImageIcon getOpenIcon(){
		ImageIcon relTag = new ImageIcon(
	    		getClass().getClassLoader().getResource(PNGPATH + "nOpenPrefs.png"));
		return relTag;
	}
	public final ImageIcon getCloseIcon(){
		ImageIcon relTag = new ImageIcon(
	    		getClass().getClassLoader().getResource(PNGPATH + "nClosePrefs.png"));
		return relTag;
	}
	public final ImageIcon getTreeViewIcon(){
		ImageIcon relTag = new ImageIcon(
	    		getClass().getClassLoader().getResource(PNGPATH + "tree.png"));
		return relTag;
	}
	public final ImageIcon getCloudViewIcon(){
		ImageIcon relTag = new ImageIcon(
	    		getClass().getClassLoader().getResource(PNGPATH + "cloud.png"));
		return relTag;
	}
		
	public final ImageIcon getImportIcon(){
		ImageIcon relTag = new ImageIcon(
	    		getClass().getClassLoader().getResource(PNGPATH + "import.png"));
		return relTag;
	}
	public final ImageIcon getExportIcon(){
		ImageIcon relTag = new ImageIcon(
	    		getClass().getClassLoader().getResource(PNGPATH + "export.png"));
		return relTag;
	}
	public final ImageIcon getDownloadIcon(){
		ImageIcon relTag = new ImageIcon(
	    		getClass().getClassLoader().getResource(PNGPATH + "download24.png"));
		return relTag;
	}
	public final ImageIcon getUploadIcon(){
		ImageIcon relTag = new ImageIcon(
	    		getClass().getClassLoader().getResource(PNGPATH + "upload24.png"));
		return relTag;
	}
	public final ImageIcon getCloseNoteIcon(){
		ImageIcon relTag = new ImageIcon(
	    		getClass().getClassLoader().getResource(PNGPATH + "closeNote.png"));
		return relTag;
	}
	
/* *******************************************
 * Graphiken fuer Editor laden
 */
	public final ImageIcon copyIcon = new ImageIcon(
    		getClass().getClassLoader().getResource(PNGPATH + "copy.png"));
    
	public final ImageIcon cutIcon = new ImageIcon(
    		getClass().getClassLoader().getResource(PNGPATH + "cut.png"));
    
	public final ImageIcon newIcon = new ImageIcon(
    		getClass().getClassLoader().getResource(PNGPATH + "new.png"));
    
	public final ImageIcon pasteIcon = new ImageIcon(
    		getClass().getClassLoader().getResource(PNGPATH + "paste.png"));
    
	public final ImageIcon propIcon = new ImageIcon(
    		getClass().getClassLoader().getResource(PNGPATH + "properties.png"));
    
	public final ImageIcon redoIcon = new ImageIcon(
    		getClass().getClassLoader().getResource(PNGPATH + "redo.png"));
    
	public final ImageIcon refreshIcon = new ImageIcon(
    		getClass().getClassLoader().getResource(PNGPATH + "refresh.png"));
    
	public final ImageIcon deleteIcon = new ImageIcon(
    		getClass().getClassLoader().getResource(PNGPATH + "delete.png"));
    
	public final ImageIcon saveIcon = new ImageIcon(
    		getClass().getClassLoader().getResource(PNGPATH + "esave.png"));
    
	public final ImageIcon saveAsIcon = new ImageIcon(
    		getClass().getClassLoader().getResource(PNGPATH + "esaveas.png"));
    
	public final ImageIcon undoIcon = new ImageIcon(
    		getClass().getClassLoader().getResource(PNGPATH + "undo.png"));
    
	public final ImageIcon leftIcon = new ImageIcon(
    		getClass().getClassLoader().getResource(PNGPATH + "left.png"));
    
	public final ImageIcon centerIcon = new ImageIcon(
    		getClass().getClassLoader().getResource(PNGPATH + "center.png"));
    
	public final ImageIcon fillIcon = new ImageIcon(
    		getClass().getClassLoader().getResource(PNGPATH + "fill.png"));
    
	public final ImageIcon rightIcon = new ImageIcon(
    		getClass().getClassLoader().getResource(PNGPATH + "right.png"));

	public final ImageIcon boldIcon = new ImageIcon(
    		getClass().getClassLoader().getResource(PNGPATH + "bold.png"));

	public final ImageIcon italicIcon = new ImageIcon(
    		getClass().getClassLoader().getResource(PNGPATH + "italic.png"));
    
	public final ImageIcon underlineIcon = new ImageIcon(
    		getClass().getClassLoader().getResource(PNGPATH + "underline.png"));

	public final ImageIcon colorIcon = new ImageIcon(
    		getClass().getClassLoader().getResource(PNGPATH + "color.png"));
    
	public final ImageIcon serifIcon = new ImageIcon(
    		getClass().getClassLoader().getResource(PNGPATH + "serif.png"));
    
	public final ImageIcon sanSerifIcon = new ImageIcon(
    		getClass().getClassLoader().getResource(PNGPATH + "sanserif.png"));
	
	public final ImageIcon linkIcon = new ImageIcon(
    		getClass().getClassLoader().getResource(PNGPATH + "link.png"));


	
/* *******************************************
 * Graphiken fuer Editor laden
 */
	public final ImageIcon getTagIcon(){
		ImageIcon addTag = new ImageIcon(
	    		getClass().getClassLoader().getResource(PNGPATH + "tag24.png"));
		return addTag;
	}
	public final ImageIcon getTagLeafIcon(){
		ImageIcon addTag = new ImageIcon(
	    		getClass().getClassLoader().getResource(PNGPATH + "tag16.png"));
		return addTag;
	}
	public final ImageIcon getTagFolderIcon(){
		ImageIcon addTag = new ImageIcon(
	    		getClass().getClassLoader().getResource(PNGPATH + "tagFolder16.png"));
		return addTag;
	}
	public final ImageIcon getExpandedIcon(){
		ImageIcon addTag = new ImageIcon(
	    		getClass().getClassLoader().getResource(PNGPATH + "expand.png"));
		return addTag;
	}
	public final ImageIcon getCollapsedIcon(){
		ImageIcon addTag = new ImageIcon(
	    		getClass().getClassLoader().getResource(PNGPATH + "collapsed.png"));
		return addTag;
	}
	public final ImageIcon getLabelCommon = new ImageIcon(
    		getClass().getClassLoader().getResource(PNGPATH + "labelCommon.png"));
	    
	public final ImageIcon getLabelHome = new ImageIcon(
    		getClass().getClassLoader().getResource(PNGPATH + "labelHome.png"));
	    
	public final ImageIcon getLabelOpen = new ImageIcon(
    		getClass().getClassLoader().getResource(PNGPATH + "labelOpen.png"));
	    
	public final ImageIcon getLabelOptions = new ImageIcon(
    		getClass().getClassLoader().getResource(PNGPATH + "labelOptions.png"));
	    
	public final ImageIcon getLabelResult = new ImageIcon(
    		getClass().getClassLoader().getResource(PNGPATH + "labelResult.png"));
	    
	public final ImageIcon getLabelNote = new ImageIcon(
    		getClass().getClassLoader().getResource(PNGPATH + "labelNote.png"));
	
	public final ImageIcon getLabelNewNote = new ImageIcon(
    		getClass().getClassLoader().getResource(PNGPATH + "labelNewNote.png"));    
	
		
/* *******************************************
 * Graphiken fuer Statusbar laden
 */
	public final ImageIcon getStatusConnect(){
		ImageIcon addTag = new ImageIcon(
	    		getClass().getClassLoader().getResource(PNGPATH + "connect.png"));
		return addTag;
	}
	public final ImageIcon getStatusDisconnect(){
		ImageIcon addTag = new ImageIcon(
	    		getClass().getClassLoader().getResource(PNGPATH + "disconnect.png"));
		return addTag;
	}
		
		
		
/* *******************************************
 * URLs laden
 */
	public final URL getStartUrl(){
		URL html = getClass().getClassLoader().getResource(HTMPATH + "start.html");
		return html;
	}
	
	public final URL getMainCSS(){
		URL html = getClass().getClassLoader().getResource(HTMPATH + "main.css");
		return html;
	}
	
/* *******************************************
 * Systempfade ermitteln
 */	
	public String getWorkDir(){
		String workDir = System.getProperty("user.home");
		if (SystemUtils.IS_OS_WINDOWS) 
			workDir += File.separator + "Eigene Dateien";
		workDir += File.separator + "Note2Go";
		
		File fWorkDir = new File(workDir);
		if (!fWorkDir.exists())
			fWorkDir.mkdir();
		
		return workDir;
	}
	
	public String getCurrPath(){
		File dir1 = new File (".");
		String currPath = "";
	    try
	    {
	    	currPath = dir1.getCanonicalPath();
	    }
	    catch(Exception e) {e.printStackTrace();}
	    return currPath;
	}
	

}
